#!/usr/bin/env python3.10.6
# -*- coding: utf-8 -*-
# Author: Bobby Sheng <Bobby@sky-cloud.net>


from flask import Flask, request
from main import cli

app = Flask(__name__)


@app.route('/jira_webhook', methods=['GET', 'POST'])
def get():
    record_key = request.args.get('key')
    res = cli(record_key)
    return {"code": 200, 'message': 'ok', 'data': {"res": res}}


if __name__ == '__main__':
    app.run(host="192.168.10.160", port=5888)
